<template>
  <el-form ref="form" :model="form" label-width="100px" :rules="rules">
    <el-form-item label="父级组织：" prop="parentName">
      <el-input size="small" v-model="form.parentName" disabled style="width:330px;"></el-input>
    </el-form-item>
    <el-form-item label="组织名称：" prop="orgName">
      <el-input size="small" v-model="form.orgName" :disabled="type=='see'" style="width:330px;"></el-input>
    </el-form-item>
    <el-form-item label="组织描述：" prop="description">
      <el-input size="small" v-model="form.description" :disabled="type=='see'" style="width:330px;"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
let rules = {
  parentName: [{required: true,message:'不可为空'}],
  orgName: [{required: true,message:'不可为空'}],
  description: [{required: true,message:'不可为空'}],

}
export default {
  name: "orgForm",
  methods:{
    validate(){
      return new Promise((res,rej)=>{
        this.$refs.form.validate((v)=>{
          if(v){
            res(v)
          }else{
            rej(v)
          }
        })
      })

    },
  },
  data() {
    return {
      rules:rules,
      type:'add',
      form: {
        parentName: '',
        orgName: '',
        parentId: '',
        orderby:'0',
        description:'',
        id:''
      },
    }
  },
}
</script>

<style scoped lang="less">

</style>